Passed
Pull Request — master (#40)
by Michael
02:21
created

T_CLASS ➔ ... ➔ ???   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
c 0
b 0
f 0
nc 2
nop 1
dl 0
loc 1
rs 10
1
class MenuView {
2
    constructor(items, editorView) {
3
        this.items = items;
4
        this.editorView = editorView;
5
6
        this.dom = document.createElement('div');
7
        this.dom.className = 'menubar';
8
        items.forEach(menuItem => this.dom.appendChild(menuItem.render(editorView)));
9
        this.update(editorView);
10
    }
11
12
    update(editorView) {
13
        this.items.forEach((item) => {
14
            item.update(editorView);
15
        });
16
    }
17
18
    destroy() {
19
        this.dom.remove();
20
    }
21
}
22
23
exports.MenuView = MenuView;
24